// create by zhangguangde
// 

import CommentItemModule from './commentItem.module.scss';

import React from 'react';
class CommentItem extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
        };
    }
    // UNSAFE_componentWillMount() {
    // }
    componentDidMount() {
    }
    // componentWillReceiveProps(newProps) {}
    // shouldComponentUpdate(newProps, newState) {
    //     return true;
    // }
    // componentWillUpdate(nextProps, nextState) {}
    // componentDidUpdate(prevProps, prevState) {}
    // componentWillUnmount() {}
    render() {

        return (
            <div className={CommentItemModule['CommentItem']}>
                <div className={CommentItemModule['comment-tittle']}>
                    <div className={CommentItemModule['header-img']}></div>
                    <div className={CommentItemModule['header-content']}>
                        <span className={CommentItemModule['username']}>
                            {this.props.commentInfo['userName']}
                        </span>
                        <br />
                        <div className={CommentItemModule['comment-star-bg']}>
                            <div className={CommentItemModule['comment-star']} style={{width: (this.props.commentInfo.score * 20) + '%'}}></div>
                        </div>
                    </div>
                    <span className={CommentItemModule['time']}>
                        {this.props.commentInfo.commentTime}
                    </span>
                </div>
                <div className={CommentItemModule['comment-content']}>
                    {this.props.commentInfo.commentContent}
                    {
                        this.props.commentInfo.replyContent ? (
                            <div className={CommentItemModule['reply-content']}>
                                <div></div>
                                <span>商户回复：</span>
                                <br />
                                <span>我是回复内容</span>
                            </div>
                        ) : (
                            <div className={CommentItemModule['reply-btn']}>
                                回复
                            </div>
                        )
                    }
                </div>
            </div>
        );
    }
}

export default CommentItem;

